include mixin
#fundpane.invisible
	ul.breadcrumb
		li
			a(href='/portal/index') 首页
		li.sep >
		li
			a(href='#/fund') 基金中心
		li.sep >
		li.cd {{info.product.title}}
		
	.yui3-g
		.yui3-u-7-12(ng-switch='!!info.product.extra.subscription_date && info.product.extra.subscription_date.length > 0')
			div(ng-switch-when='false')
				table.bc
					tr(ng-switch='isCurrencyFund')
						td(ng-switch-when='true', colspan=6, gf-chart='chartData', id='fundchart', style='height: 284px;*height: 309px;', data-option="{unit: '%'}")
						td(ng-switch-when='false', colspan=6, gf-chart='chartData', id='fundchart', style='height: 284px;*height: 309px;', data-option="{compare: 'percent'}")
					tr
						td &nbsp;
						td 一个月
						td 三个月
						td 六个月
						td 今年以来
						td 过去一年
					tr
						td.b.padleft0.padright0 总回报(%)
						td {{info.return_rates.yieldrate1m | percentage : 2}}
						td {{info.return_rates.yieldrate3m | percentage : 2}}
						td {{info.return_rates.yieldrate6m | percentage : 2}}
						td {{info.return_rates.yieldratety | percentage : 2}}
						td {{info.return_rates.yieldrate1y | percentage : 2}}
						
				.mtop10.tar 净值日期 : {{info.return_rates.init_date | datehyphen : !0}}
		
			table.border(ng-switch-when='true', style='height: 400px;')
				tr
					td(width='100%', height='100%').vam.nomp
						img(ng-src='/_image/pdt_fund_{{info.product.id}}', width='85%', height='85%')
				
		.yui3-u-1-24 &nbsp;
		
		section.yui3-u-3-8.relative
			header.yui3-u.relative
				h1.nomp.bc.ib(style='margin-top: -12px;') {{info.product.title}}
				.titledata(ng-switch='isCurrencyFund')
					small(ng-switch-when='true', ng-show='!!info.basic.dailyreturn || !!info.basic.annuyield')
						| (
						span(ng-bind='info.basic.dailyreturn | number : 4')
						span(ng-show='!!info.basic.annuyield') , 
						| {{info.basic.annuyield | percentage : 2}})
					small(ng-switch-when='false', ng-show='!!info.product.pricing[0].price || !!info.product.pricing[0].change_rate')
						| (
						span {{info.product.pricing[0].price | number : 2}}
						span(ng-show='!!info.product.pricing[0].change_rate') , 
						span.rc(ng-show='info.product.pricing[0].change_rate>0') +
						span(ng-class='{grc: info.product.pricing[0].change_rate<0, rc: info.product.pricing[0].change_rate>0}', ng-show='info.product.pricing[0].change_rate', ng-bind='info.product.pricing[0].change_rate | percentage : 2')
						| )
				.gc.font.nor 基金代码: {{info.product.code}}
			//- 基金优惠屏蔽代码
			.saleCircle(ng-mouseenter="showSale=true",ng-mouseleave="showSale=false",ng-show="info.product.extra.discount[0].discount && info.product.extra.discount[0].discount!=1")
				.saleNum(ng-bind="info.product.extra.discount[0].discount*10 || 10 | number:0",ng-class="{saleNum28 : info.product.extra.discount[0].discount==1 || !info.product.extra.discount[0].discount}")
				.saleName 折
				.saleShengou 申购费
				.saleArrow(ng-show="showSale")
			.saleContent(ng-show="showSale",ng-mouseenter="showSale=true",ng-mouseleave="showSale=false") 通过网上交易系统委托、手机证券委托软件申购我司代理销售的部分开放式基金（场外前端模式）享受此费率优惠

			div(ng-switch='!!info.product.extra.subscription_date && info.product.extra.subscription_date.length > 0')
				.yui3-g(ng-switch-when='false',style="margin-top:12px;")
					.yui3-u-1-2
						time.b 成立时间：
						| {{info.basic.contracteffectdate | date : 'yyyy-MM-dd'}}
					.yui3-u-1-2
						b 累计效益(%)：
						| {{info.return_rates.yieldrate | percentage : 2}}

				div(ng-switch-when='true')
					.mtop30
						b 发售时间：
						| {{info.product.extra.subscription_date[0] | date : 'yyyy年MM月dd日'}} - {{info.product.extra.subscription_date[1] | date : 'yyyy年MM月dd日'}}
					.mtop10
						b 基金管理人：
						| {{info.basic.managementcom}}

			.mtop10.yui3-g
				.yui3-u-1-2
					b 投资类型：
					| {{info.product.extra.category|category}}
				.yui3-u-1-2
					b 风险等级：
					| {{fundRiskLevelLabels[info.basic.risklevel]}}
			.mtop10
				b 最低参与金额：
				| {{info.product.extra.min_amount}}元

			.mtop10
				b 收费方式：
				.ib.mright15(ng-hide='info.product.extra.charge_type == 1')
					input.checkbox(type='radio', id='payment_type0', ng-model='payment_type', name='payment_type', value='0')
					label(for='payment_type0') 前端收费
				.ib(ng-hide='info.product.extra.charge_type == 0')
					input.checkbox(type='radio', id='payment_type1', ng-model='payment_type', name='payment_type', value='1')
					label(for='payment_type1') 后端收费

			div(ng-switch='!!info.product.extra.subscription_date && info.product.extra.subscription_date.length > 0')
				div(ng-switch-when='false')
					.mtop10
						b 产品等级：
							span(gf-star, gf-star-score="{{info.basic.prodlevel}}")
			
					.mtop10
						b 购买金额:
						input(type='number', ng-model='$parent.number', min=0, maxlength=20, required).w5em
						| 元

				.mtop10(ng-switch-when='true')
					b 购买金额:
					input(type='number', ng-model='$parent.number', min=0, maxlength=20, required).w5em
					| 元
			
			footer.mtop20.border.pad10.boxbg(ng-switch='info.product.extra2.xslb', ng-hide='info.product.hot < 0 || (-1 == info.product.extra.charge_type && info.product.extra2.xslb == 0)')
				div(ng-switch-when=0)
					.mtop10(ng-switch='!cart.exists[info.product.id]')
						div(ng-switch-when='true')
							span.mrem2 已选择: {{info.product.title}}
							| 总价
							span.mlem.rc  ￥{{number || 0}}
						div(ng-switch-when='false') 该产品已在购物车中！

					.mtop10.mbottom10
						span(ng-switch='!cart.exists[info.product.id]')
							a(href='javascript:void(0);', ng-switch-when='true', ng-hide='!(number>=info.product.extra.min_amount)', ng-click='add()').btn.primary.minor.mlem.mtop10 加入购物车
							a.btn.primary.minor.mlem(ng-switch-when='false', href='#/cart') 查看购物车
						a(href='#', onclick='return false', ng-show='number>=info.product.extra.min_amount', ng-click='purchase_yht(info.product, info.product.id, 0, number, payment_type, info.product)').btn.primary.mtop10.mlem 立即购买

				div(ng-switch-default)
					.mtop10
						span.mrem2 已选择: {{info.product.title}}
							| 总价
							span.mlem.rc  ￥{{number || 0}}
					.mtop10.mbottom10
						if debug
							a(gf-href="http://testtrade.gf.com.cn:9080/etrade/oauth2.jsp?menu=kfjj&node=KFJJDTView&params={fund_company:{{info.basic.managementcomcode}},fund_code:{{info.product.code}},balance:{{number}}}", ng-show='number>=info.product.extra.min_amount', target='_blank').btn.primary.mtop10.mlem 立即购买
						else
							a(gf-href="https://trade.gf.com.cn/oauth2.jsp?origin=store&menu=stock&node=CNJJSGView", ng-show='number>=info.product.extra.min_amount', target='_blank').btn.primary.mtop10.mlem 立即购买

	.mtop20.grid-col2-v2.ng-cloak.fd-detail
		.col-v2
			.border.boxtab
				.tabbar-v2(ng-init='tab=1')
					.tab-v2.tab-pad
					.tab-v2(ng-class="{active: tab==1}", ng-click="tab=1") 基金简介
					.tab-v2(ng-class="{active: tab==2}", ng-click="tab=2") 基金公告
					.tab-v2(ng-class="{active: tab==3}", ng-click="tab=3") 资金费率
					.tab-v2(ng-class="{active: tab==4}", ng-click="tab=4", ng-hide='!!info.product.extra.subscription_date && info.product.extra.subscription_date.length > 0') 基金分红
					.tab-v2(ng-class="{active: tab==5}", ng-click="tab=5", ng-hide='!!info.product.extra.subscription_date && info.product.extra.subscription_date.length > 0') 资产配置
					.tab-v2(ng-class="{active: tab==6}", ng-click="tab=6", ng-hide='!!info.product.extra.subscription_date && info.product.extra.subscription_date.length > 0') 基金经理
					.tab-v2(ng-class="{active: tab==7}", ng-click="tab=7", ng-hide='!!info.product.extra.subscription_date && info.product.extra.subscription_date.length > 0') 基金净值
					.tab-v2.tab-pad
				.content(ng-switch='tab')
					section(ng-switch-when=1, ng-switch='!!info.product.extra.subscription_date && info.product.extra.subscription_date.length > 0').pad10
						table.bc(ng-switch-when='false')
							colgroup
								col(width='25%')
								col(width='75%')
							tr.graybg
								td.tac.vam.b 基金名称
								td.tal.vam {{info.product.name}}
							tr
								td.tac.vam.b 基金代码
								td.tal.vam {{info.basic.tradingcode}}
							tr.graybg
								td.tac.vam.b 成立日期
								td.tal.vam {{info.basic.contracteffectdate | date : 'yyyy-MM-dd'}}
							tr
								td.tac.vam.b 风险收益特征
								td.tal.vam {{info.basic.riskreturnfeature}}
							tr.graybg
								td.tac.vam.b 基金管理人
								td.tal.vam {{info.basic.managementcom}}
							tr
								td.tac.vam.b 基金托管人
								td.tal.vam {{info.basic.custodian}}
							tr.graybg
								td.tac.vam.b 投资目标
								td.tal.vam {{info.basic.invobjective}}
							tr
								td.tac.vam.b 投资范围
								td.tal.vam {{info.basic.invscope}}
							tr.graybg
								td.tac.vam.b 投资策略
								td.tal.vam {{info.basic.invstrategy}}
							tr
								td.tac.vam.b 业绩比较基准
								td.tal.vam {{info.basic.benchmark}}

						pre(ng-switch-when='true') {{info.product.description}}

					section(ng-switch-when=2, ng-controller='App.FundAnnounceCtrl').pad10
						nav
							ul.fd-notice
								li(ng-repeat='item in data.items', ng-class='{border: showAttach==$index}').relative
									a.notice(href='#', onclick='return false', ng-click='toggle($index)', ng-class='{graybg: showAttach==$index, stress: showAttach==$index, b: showAttach==$index}', style='text-decoration: none;')
										time(pubdate).bc.pull-right {{item.pub_date|datehyphen}}
										img(src='../img/blank.gif', ng-class='{down: showAttach!=$index, up: showAttach==$index}').cp.mright10
										span {{item.title}}
									
									.pad10(ng-show='showAttach==$index', ng-controller='App.FundAnnounceDetailCtrl', style='height: 300px;overflow-y:auto;')
										pre {{detail.text}}
										
										.mtop10
											a(ng-repeat='item in detail.attachments', title='下载文档', href='/fund/blt/attach/{{item.id}}', target='_blank').mrem.link {{item.name}}
							mixin pager
					
					section(ng-switch-when=3).pad10
						table.bc
							colgroup
								col(width='25%')
								col(width='75%')
							tr(ng-repeat='item in info.detail.feerate', ng-class-odd="'graybg'", ng-class='{"blur-btop" : $index == 0}')
								td.tac.vam.b {{item.constdesc}}
								td.tal.vam {{item.feeratedesc}}
					
					section(ng-switch-when=4).pad10
						table.bc(ng-show='info.detail.devidend.length')
							thead
								tr.selected.blur-bbottom
									th.padleft0.padright0.vam 分红年度/可分配收益基准日
									th.vam 权益登记日
									th.vam 红利发放日
									th.vam 每10份收益单位减息(元)
							tbody
								tr(ng-repeat='item in info.detail.devidend', ng-class-even="'graybg'")
									td {{item.exdividateotc|date:'yyyy-MM-dd'}}
									td
										time {{item.rightregdate|date:'yyyy-MM-dd'}}
									td
										time {{item.divipaydate|date:'yyyy-MM-dd'}}
									td {{item.cashbtaxrmb_10 | number : 2}}
								
					section(ng-switch-when=5, ng-init='refreshIframe()').pad10
						table.bc(ng-show='assetdata.length')
							tr
								td
									h3.nomp.tal.gc 资产分布
									.chart_h(gf-chart='assetdata', gf-pie)	
								td.nopad
									table
										thead	
											tr
												th.font14.vam.selected.blur-bbottom.notop.noleft 资产类型
												th.font14.vam.selected.blur-bbottom.notop 金额(亿元)
												th.font14.vam.selected.blur-bbottom.notop.noright 占基金总资产比例(%)
										tbody
											tr(ng-repeat='item in assetdata', ng-class-even="'graybg'")
												td.vam.noleft {{item.zclx}}
												td.vam {{item.holdingval/1e8 | number : 2}}
												td.vam.noright {{item.pctoftotalasset | percentage : 2}}
						
						table.mtop20.bc(ng-show='indudata.length')
							tr	
								td
									h3.nomp.tal.gc 行业分布
									.chart_h(gf-chart='indudata', gf-pie)
								td.nopad
									table
										thead
											tr
												th.font14.vam.selected.blur-bbottom.notop.noleft 资产类型
												th.font14.vam.selected.blur-bbottom.notop 金额(亿元)
												th.font14.vam.selected.blur-bbottom.notop.noright 占基金总资产比例(%)
										tbody
											tr(ng-repeat='item in indudata', ng-class-even="'graybg'")
												td.vam.noleft {{item.zclx}}
												td.vam {{item.holdingval/1e8 | number : 2}}
												td.vam.noright {{item.pctoftotalasset | percentage : 2}}
								
						.pad20(ng-show='info.detail.portfolio.secu.length')
							b.font16 十大股票持仓
						table.bc(ng-show='info.detail.portfolio.secu.length')
							thead
								tr.font14.vam.selected.blur-bbottom
									th(style='width: 80px;').vam 序号
									th(style='width: 100px;*width: 120px;').vam 股票代码
									th.vam 股票名称
									th(style='width: 110px;*width: 140px;').vam 净值占比(%)
							tbody(ng-init='secuFilter();')
								tr(ng-repeat='item in info.detail.portfolio.secu', ng-class-even="'graybg'")
									td.padleft.padright.vam {{$index+1}}
									td.vam {{item.tradingcode}}
									td.vam {{item.secuabbr}}
									td.vam {{item.pctoftotalasset | number : 2}}

						.pad20(ng-show='info.detail.portfolio.bond.length')
							b.font16 十大债券持仓
						table.mtop10.bc(ng-show='info.detail.portfolio.bond.length')
							thead
								tr.font14.vam.selected.blur-bbottom
									th.vam 序号
									th.vam 债券名称
									th.vam 净值比例(%)
							tbody
								tr(ng-repeat='item in info.detail.portfolio.bond', ng-class-even="'graybg'")
									td.vam {{$index+1}}
									td.vam {{item.bondabbr}}
									td.vam {{item.pctoftotalasset | number : 2}}
									
					section(ng-switch-when=6, ng-init='refreshIframe()')
						.blur-bbottom
							h2.padleft10 现任基金经理
						.pad10(ng-repeat='p in managers')
							.clearfix
								.pull-left.mbottom15(ng-switch='!!p.managerphoto')
									img(ng-switch-default, ng-src='/fund/blt/attach/{{p.managerphoto}}', alt='{{p.pname}}', style='width: 110px;height: 150px;border: 1px solid #E5E5E5;')
									img(ng-switch-when='false', ng-src='../img/no_pic.jpg', alt='{{p.pname}}', style='width: 110px;height: 150px;border: 1px solid #E5E5E5;')
								div(style='margin-left: 130px;')
									.font14.afc.pull-right
										| 任职时间: {{p.positionstartdate | date : 'yyyy-MM-dd'}} 至今
									.font16
										b 姓名：
										| {{p.pname}}
									p {{p.background}}
							.btop(style='border-top-style: dashed;_margin-top: 12px;', ng-show='!$last')

						div(ng-show='managers2.length > 0')
							.blur-bbottom
								h2.padleft10 历任基金经理
							div(ng-init='managerinfo=managers2[0];mpage=1')
								.border.manager-basket.nobottom.graybg
									.arrow(ng-show='mpage > 1', ng-click='mpage=mpage-1', title='上一页')
									.arrow.right(ng-show='mpage*8 < managers2.length', ng-click='mpage=mpage+1', title='下一页')
									.padtop15.padbottom15
										a.mleft8.mright8(href='#', onclick='return false;', ng-repeat='p in managers2.slice((mpage-1)*8, mpage*8)', ng-switch='!!p.managerphoto', ng-click='$parent.managerinfo=p')
											img.manager-pic(ng-switch-default, ng-class='{imgopacity: $parent.managerinfo!=p}', ng-src='/fund/blt/attach/{{p.managerphoto}}', alt='{{p.pname}}')
											img.manager-pic(ng-switch-when='false', ng-class='{imgopacity: $parent.managerinfo!=p}', ng-src='../img/no_pic.jpg', alt='{{p.pname}}', alt='{{p.pname}}')
								.pad10
									.font14.afc.pull-right
										| 任职时间: {{managerinfo.positionstartdate | date : 'yyyy-MM-dd'}} 至 {{managerinfo.positionenddate | date : 'yyyy-MM-dd'}}
									.font16
										b 姓名：
										| {{managerinfo.pname}}
									p {{managerinfo.background}}

					section(ng-switch-when=7, ng-controller='App.FundNetWorthCtrl').pad10
						div(ng-show='data.items')
							form.padbottom20(name='dateform', ng-submit='getData(true, showtype)').nobottom
								span.mrem 日期从
								input(type='text', ng-model='beginDate', gf-date, readonly).graybg.lrem.mrem
								span.mrem 到
								input(type='text', ng-model='endDate', gf-date, readonly).graybg.lrem.mrem
								input(type='submit', value='', ng-disabled='!loaded').search-btn.mrem
								img(src='../img/loading.gif', width='16', height='16', ng-hide='loaded')
								
							.btop

							.tar.pad15(ng-init='showtype=2')
								.graph-icon.mright10
								a(href='javascript:void(0)', ng-class='{link: showtype==2}', ng-click="showtype=1;getData(true, showtype);").b.mright15 图形
								.entry-icon.mright10
								a(href='javascript:void(0)', ng-class='{link: showtype==1}', ng-click='showtype=2;getData(false, showtype);').b 列表
							
							div(ng-switch='showtype')
								div(ng-switch-when='2')
									table.bc
										thead
											tr.selected.blur-bbottom
												th 净值日期
												th(ng-hide='isCurrencyFund') 份额净值
												th(ng-hide='isCurrencyFund') 累计净值
												th(ng-hide='isCurrencyFund') 净值增长率
												th(ng-show='isCurrencyFund') 万份收益
												th(ng-show='isCurrencyFund') 七日年化收益

										tbody
											tr(ng-repeat='item in data.items', ng-class-even="'graybg'")
												td
													time {{item.nav_date|datehyphen}}
												td(ng-hide='isCurrencyFund') {{item.share_nav | number : 4}}
												td(ng-hide='isCurrencyFund') {{item.accum_nav | number : 4}}
												td(ng-class='{grc: item.changerate < 0, rc: item.changerate > 0}', ng-hide='isCurrencyFund') {{item.changerate | percentage : 2}}
												td(ng-show='isCurrencyFund') {{item.dailyreturn | number : 4}}
												td(ng-show='isCurrencyFund') {{item.annuyield | percentage : 2}}
															
									mixin pager

								div(ng-switch-when='1', gf-chart='netWorthChartData', id='fundNetWorthchart', data-option="{compare: 'percent', tickPixelInterval: 150}")
			
		aside.col-v2.money-col-v2
			mixin hottest
			mixin history
